package cn.skcks.springboot03.controller;

import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;

import java.util.Arrays;

// 在templates 目录下的所有页面只能通过 controller 来跳转
// 需要模板引擎的支持
@Controller
public class IndexController {
	@RequestMapping(value = "/index")
	public String index(Model model) {
		model.addAttribute("msg", "<b>Thymeleaf</b>");
		model.addAttribute("list", Arrays.asList("1", "2", "3", "4", "5", "6"));

		return "index";
	}

	@RequestMapping(value = "/intercepter")
	public String intercepter() {
		return "intercepter";
	}
}